<template>
	<view>
		<view class="nabbar" :style="{'height': statusBarHeight + barHeight + 'px'}">
			<!-- //手机状态栏 -->
			<view class="status-bar" :style="{'height': statusBarHeight + 'px'}"></view>
			<!-- //导航栏 -->
			<view class="nabbar-box" :style="{ 'top': statusBarHeight+ 'px', 'heigth': barHeight + 'px' }">
				<view class="nabbar-cont">
					<view @click="toBack()" style="position: absolute;left: 20rpx;">
						<uni-icons type="left" size="20" color="#fff"></uni-icons>
					</view>
					<view>流动申报</view>
				</view>
			</view>
		</view>
		<image src="../../static/images/bg.png" class="bg"></image>
		<view class="main">
			<view class="item" @click="toUrl(1)">流出申报
				<text>（修水党员流出到外地）</text>
			</view>
			<view class="item" @click="toUrl(2)">流入申报
				<text>（外地党员流入到修水）</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: 20,
				barHeight: 44,
				barWidth: null,
			}
		},
		methods: {
			toBack() {
				uni.navigateBack()
			},
			toUrl(n) {
				uni.navigateTo({
					url: '/pages/apply/form?type=' + n
				})
			},

		},
		onLoad() {
			let that = this;
			//通过uni自带api获取手机系统信息
			uni.getSystemInfo({
				success: function(res) {
					// console.log(res)
					that.statusBarHeight = res.statusBarHeight; //手机状态栏高度
					let isiOS = res.system.indexOf('iOS') > -1; //是否为iOS系统
					that.barHeight = !isiOS ? 48 : 44; //导航栏高度，iOS：48，Android：44
					that.barWidth = res.windowWidth - 87; //nabbar可操作宽度 = 屏幕宽度 - 小程序右上角的胶囊宽度（87）
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
	}

	.main {
		position: relative;
		padding-top: 380rpx;
	}

	.item {
		background: white;
		width: 484rpx;
		text-align: center;
		border-radius: 8rpx;
		color: #FF9008;
		font-size: 38rpx;
		margin: 0 auto 180rpx;
		padding: 20rpx 0;

		text {
			display: block;
			font-size: 24rpx;
			color: #532f02;
			margin-top: 10rpx;
		}
	}
</style>